/*    */ package openmyexplorer.util;
/*    */ 
/*    */ import java.io.File;
/*    */ import java.io.IOException;
/*    */ 
/*    */ public class Utils
/*    */ {
/*    */   public static String detectLinuxSystemBrowser()
/*    */   {
/* 42 */     String result = executeCommand("which nautilus");
/* 43 */     if ((result == null) || (result.trim().equals(""))) {
/* 44 */       result = executeCommand("which dolphin");
/*    */     }
/* 46 */     if ((result == null) || (result.trim().equals(""))) {
/* 47 */       result = executeCommand("which thunar");
/*    */     }
/* 49 */     if ((result == null) || (result.trim().equals(""))) {
/* 50 */       result = executeCommand("which pcmanfm");
/*    */     }
/* 52 */     if ((result == null) || (result.trim().equals(""))) {
/* 53 */       result = executeCommand("which rox");
/*    */     }
/* 55 */     if ((result == null) || (result.trim().equals(""))) {
/* 56 */       result = executeCommand("xdg-open");
/*    */     }
/* 58 */     if ((result == null) || (result.trim().equals(""))) {
/* 59 */       result = "other";
/*    */     }
/* 61 */     String[] pathnames = result.split(File.separator);
/* 62 */     return pathnames[(pathnames.length - 1)];
/*    */   }
/*    */ 
/*    */   public static String executeCommand(String command)
/*    */   {
/* 72 */     String stdout = null;
/*    */     try {
/* 74 */       Process process = Runtime.getRuntime().exec(command);
/* 75 */       stdout = IOUtils.toString(process.getInputStream());
/* 76 */       stdout = stdout.trim();
/* 77 */       stdout = stdout.replace("\n", "");
/* 78 */       stdout = stdout.replace("\r", "");
/*    */     } catch (IOException e) {
/* 80 */       e.printStackTrace();
/*    */     }
/* 82 */     return stdout;
/*    */   }
/*    */ }

/* Location:           F:\Eclipse2020\eclipse\dropins\OpenExplorer_1.5.0.v201108051513.jar
 * Qualified Name:     openexplorer.util.Utils
 * JD-Core Version:    0.6.2
 */